/* 商品详情页样式 */

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem 0;
  font-size: 0.875rem;
  width: 100%;
  max-width: 100%;
}

.breadcrumb-item {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.breadcrumb-item:hover {
  color: #3b82f6;
}

.breadcrumb-item.active {
  color: #1f2937;
  font-weight: 500;
}

.breadcrumb-separator {
  color: #9ca3af;
  margin: 0 0.25rem;
  flex-shrink: 0;
}

/* 商品图片画廊 */
.goods-gallery {
  position: relative;
  width: 100%;
}

.goods-image-container {
  position: relative;
  width: 100%;
  /* aspect-ratio: 2 / 1; */
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: #f8f9fa;
}

/* 兼容不支持aspect-ratio的浏览器 */
@supports not (aspect-ratio: 2 / 1) {
  .goods-image-container {
    height: 0;
    padding-bottom: 50%; /* 50% = 1/2，实现2:1比例 */
  }

  .goods-image-container img {
    position: absolute;
    top: 0;
    left: 0;
  }
}

.goods-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.goods-image-container:hover img {
  transform: scale(1.05);
}

/* 图片导航按钮 */
.image-nav-btn {
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.goods-image-container:hover .image-nav-btn {
  opacity: 1;
}

.image-nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.8) !important;
}

/* 商品信息区域 */
.goods-info {
  padding-left: 2rem;
}

.goods-title {
  font-size: 1.875rem;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.goods-price {
  font-size: 2rem;
  font-weight: bold;
  color: #ef4444;
  margin-bottom: 1rem;
}

.goods-price .original-price {
  font-size: 1rem;
  color: #9ca3af;
  text-decoration: line-through;
  margin-left: 0.5rem;
}

/* 商品标签 */
.goods-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.goods-tag {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.goods-tag.free {
  background-color: #dcfce7;
  color: #166534;
}

.goods-tag.vip {
  background-color: #fef3c7;
  color: #92400e;
}

.goods-tag.hot {
  background-color: #fee2e2;
  color: #991b1b;
}

/* 操作按钮 */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.btn-primary {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-secondary {
  padding: 0.75rem 1rem;
  background-color: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  color: #ef4444;
  border-color: #ef4444;
}

/* 标签页导航 */
.tab-nav {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 2rem;
}

.tab-button {
  padding: 1rem 0;
  margin-right: 2rem;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: fit-content;
}

.tab-button:hover {
  color: #374151;
}

.tab-button.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* 标签页内容 */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 商品内容 */
.goods-content {
  line-height: 1.8;
}

/* 商品内容中的图片样式 */
.goods-content img,
.goods-description img,
.prose img,
.paid-content-full img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem auto;
  display: block;
}

/* 确保所有内容区域的图片都居中 */
#goods-content-area img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem auto;
  display: block;
}

.goods-content h1,
.goods-content h2,
.goods-content h3 {
  margin: 1.5rem 0 1rem 0;
  font-weight: 600;
}

.goods-content p {
  margin-bottom: 1rem;
}

/* 章节列表 */
.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: between;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.chapter-item:hover {
  border-color: #3b82f6;
  background-color: #f8fafc;
}

.chapter-title {
  flex: 1;
  font-weight: 500;
}

.chapter-status {
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
}

.chapter-status.free {
  background-color: #dcfce7;
  color: #166534;
}

.chapter-status.paid {
  background-color: #fef3c7;
  color: #92400e;
}

.chapter-status.locked {
  background-color: #f3f4f6;
  color: #6b7280;
}

/* 评论区域 */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.comment-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: #e5e7eb;
}

.comment-author {
  font-weight: 500;
}

.comment-time {
  color: #6b7280;
  font-size: 0.875rem;
}

.comment-content {
  line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .goods-info {
    padding-left: 0;
    margin-top: 2rem;
  }

  .goods-title {
    font-size: 1.5rem;
  }

  .goods-price {
    font-size: 1.5rem;
  }
}

@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
  }

  .tab-button {
    margin-right: 1rem;
    font-size: 0.875rem;
  }

  /* 移动端标签导航优化 */

  .tab-nav-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
  }
  .tab-nav-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
  }
  .tab-nav-wrapper {
    display: flex;
    min-width: max-content;
  }
  .tab-button {
    white-space: nowrap;
  }
  .tab-button i {
    margin-right: 0.25rem;
  }
}
